package com.ss.android.article.base.feature.subscribe.model;

import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.Rect;
import android.graphics.RectF;
import com.ss.android.image.AvatarLoader.Transformer;

public final class b implements Transformer {
    private final int a;
    private final int b;
    private final int c;

    public b(int arg2, int arg3, int arg4) {
        this(arg2, arg3, arg4, (byte) 0);
    }

    private b(int arg1, int arg2, int arg3, byte arg4) {

        this.b = arg1;
        this.a = arg2;
        this.c = arg3;
    }

    public final Bitmap transform(Bitmap bitmap) {
        Bitmap v0;
        if(bitmap == null) {
            v0 = null;
        }
        else {
            v0 = Bitmap.createBitmap(this.b, this.b, Bitmap.Config.ARGB_8888);
            Canvas v1 = new Canvas(v0);
            Paint v2 = new Paint();
            Rect v3 = new Rect(0, 0, this.b, this.b);
            Rect v4 = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight());
            RectF v5 = new RectF(v3);
            float v6 = ((float)this.a);
            v2.setAntiAlias(true);
            v2.setDither(true);
            v1.drawARGB(0, 0, 0, 0);
            v2.setStyle(Paint.Style.FILL);
            v2.setColor(-12434878);
            v1.drawRoundRect(v5, v6, v6, v2);
            v2.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));
            v1.drawBitmap(bitmap, v4, v3, v2);
            v2.setColor(-2236963);
            v2.setStyle(Paint.Style.STROKE);
            v2.setStrokeWidth(((float)this.c));
            v1.drawRoundRect(v5, v6, v6, v2);
        }

        return v0;
    }
}

